{
  "name": "Case 16 – M&A Target Screening",
  "nodes": [
    {
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2,
      "position": [0, 0],
      "parameters": {
        "formTitle": "M&A Target Financial Submission",
        "formDescription": "Upload target company financials for acquisition screening",
        "formFields": {
          "values": [
            { "fieldLabel": "Target Company Name", "requiredField": true },
            { "fieldLabel": "Contact Email", "fieldType": "email", "requiredField": true },
            {
              "fieldLabel": "Target_Financials",
              "fieldType": "file",
              "acceptFileTypes": ".pdf",
              "requiredField": true
            }
          ]
        }
      }
    },
    {
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [220, 0],
      "parameters": {
        "inputDataFieldName": "Target_Financials",
        "name": "={{ $json['Target Company Name'] + '_Financials' }}",
        "folderId": "REPLACE_WITH_MA_TARGETS_FOLDER_ID"
      }
    },
    {
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [420, 0],
      "parameters": {
        "operation": "download",
        "fileId": "={{ $json.id }}"
      }
    },
    {
      "name": "Extract Target Financials",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [620, 0],
      "parameters": {
        "operation": "pdf"
      }
    },
    {
      "name": "Download Acquisition Strategy & Screening Criteria",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [820, 0],
      "parameters": {
        "operation": "download",
        "fileId": "REPLACE_WITH_ACQUISITION_STRATEGY_FILE_ID"
      }
    },
    {
      "name": "Extract Acquisition Strategy",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [1020, 0],
      "parameters": {
        "operation": "pdf"
      }
    },
    {
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3,
      "position": [220, 260],
      "parameters": {
        "promptType": "define",
        "text": "=Target Company Financials:\n{{ $('Extract Target Financials').item.json.text }}\n\nAcquisition Strategy & Screening Criteria:\n{{ $('Extract Acquisition Strategy').item.json.text }}",
        "options": {
          "systemMessage": "You are a Corporate M&A Committee Member responsible for initial acquisition screening.\n\nYOUR OBJECTIVE:\nIdentify acquisition targets that align with strategic priorities and deliver attractive risk-adjusted financial returns, while filtering out misaligned or value-destructive opportunities.\n\nANALYSIS FRAMEWORK (MANDATORY):\n1. STRATEGIC FIT – alignment with core business, adjacencies, and long-term growth themes.\n2. MARKET ATTRACTIVENESS – industry growth, competitive intensity, and sustainability.\n3. FINANCIAL PERFORMANCE – revenue growth, margins, cash flows, and earnings quality.\n4. VALUATION & RETURN POTENTIAL – implied multiples, synergies, and return thresholds.\n5. RISK FACTORS – integration complexity, customer concentration, regulatory or technology risk.\n\nYOU MUST PRODUCE ONE JSON OBJECT WITH EXACTLY THESE FIELDS. ALL FIELDS ARE MANDATORY.\n\nJSON SCHEMA (STRICT):\n{\n  \"Target_Company_Name\": \"string\",\n  \"Industry_Sector\": \"string\",\n  \"Revenue_INR_Cr\": \"number\",\n  \"EBITDA_Margin_Percentage\": \"number\",\n  \"Revenue_Growth_Rate_Percentage\": \"number\",\n  \"Strategic_Fit\": \"Low | Medium | High\",\n  \"Market_Attractiveness\": \"Low | Medium | High\",\n  \"Financial_Health\": \"Weak | Moderate | Strong\",\n  \"Estimated_Valuation_Multiple\": \"number\",\n  \"Integration_Risk\": \"Low | Medium | High\",\n  \"Overall_MA_Fit_Score_out_of_100\": \"number\",\n  \"Screening_Decision\": \"Move to Due Diligence | Drop Target\",\n  \"MA_Committee_Notes\": \"string\"\n}\n\nINSTRUCTIONS:\n- Numeric fields MUST contain numbers only.\n- Do NOT add, remove, or rename fields.\n- Output ONLY valid JSON.\n- IMMEDIATELY call the Google Sheets Append Row tool using this JSON."
        }
      }
    },
    {
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [0, 420],
      "parameters": {
        "model": {
          "mode": "list",
          "value": "gpt-4.1-mini"
        }
      }
    },
    {
      "name": "Append row",
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4,
      "position": [420, 460],
      "parameters": {
        "operation": "append",
        "documentId": "REPLACE_WITH_GOOGLE_SHEET_ID",
        "sheetName": "M&A Target Screening Register"
      }
    },
    {
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [420, 260],
      "parameters": {
        "sendTo": "={{ $('On form submission').item.json['Contact Email'] }}",
        "subject": "M&A Target Screening – Preliminary Outcome",
        "message": "={{ 'Dear Team,<br><br>Your company has been evaluated against our acquisition screening criteria. We will reach out shortly regarding the next steps in the process.<br><br>Corporate Development Team' }}"
      }
    }
  ],
  "connections": {
    "On form submission": { "main": [[{ "node": "Upload file" }]] },
    "Upload file": { "main": [[{ "node": "Download file" }]] },
    "Download file": { "main": [[{ "node": "Extract Target Financials" }]] },
    "Extract Target Financials": { "main": [[{ "node": "Download Acquisition Strategy & Screening Criteria" }]] },
    "Download Acquisition Strategy & Screening Criteria": { "main": [[{ "node": "Extract Acquisition Strategy" }]] },
    "Extract Acquisition Strategy": { "main": [[{ "node": "AI Agent" }]] },
    "OpenAI Chat Model": { "ai_languageModel": [[{ "node": "AI Agent" }]] },
    "Append row": { "ai_tool": [[{ "node": "AI Agent" }]] },
    "AI Agent": { "main": [[{ "node": "Send Email" }]] }
  },
  "active": false
}
